﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Basmus.ReadWrite;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Basmus.Tests.ReadWrite
{
    [TestClass]
    public class ReadResultGenericTest
    {
        [TestMethod]
        public void SuccessTest()
        {
            var result = 100;
            var readResult = ReadResult<int>.Success(result);

            Assert.IsTrue(readResult.Successful);
            Assert.AreEqual(readResult.Value, result);
        }

        [TestMethod]
        public void ErrorTest()
        {
            var result = 100;
            var readResult = ReadResult<int>.Error();

            Assert.IsFalse(readResult.Successful);
        }
    }
}
